package com.jl.enums;

import org.springframework.util.StringUtils;

/*
房间类型
 */
public enum GameType {

    type1("1","牛牛","NiuNiu"),
    type2("2","斗公牛","GongNiu"),
    type3("3","炸金花","ZhaJinHua");

    private String id;
    private String desc;
    private String desc2;

    GameType(String id, String desc, String desc2) {
        this.id = id;
        this.desc = desc;
        this.desc2 = desc2;
    }

    public String getDesc2() {
        return desc2;
    }

    public String getId() {
        return id;
    }

    public String getDesc() {
        return desc;
    }

    public static String getDesc2ById(String id){
        if (!StringUtils.isEmpty(id)){
            GameType[] values = GameType.values();
            for (GameType value : values) {
                if (id.equals(value.id)){
                    return value.getDesc2();
                }
            }
        }
        return null;
    }
}
